#include <stdio.h>
#define N 4
#define M 3

int max(int a[M][N]) {
	int t, m, n;
	t = a[0][0];
	for (m = 0; m < M; m++)
		for (n = 0; n < N; n++)
			if (t < a[m][n])
				t = a[m][n];
	return t;
}

int main () {
	int m, n, a[M][N], t;
	for (m = 0; m < M; m++)
		for (n = 0; n < N; n++)
			scanf ("%d", &a[m][n]);
	printf("%d", max(a));
}
